Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[MNG-6774] - Speedup project graph build by paralleling operations #290

Closed
wants to merge 1 commit into from
Closed

[MNG-6774] - Speedup project graph build by paralleling operations #290

wants to merge 1 commit into from

Conversation

AlexanderAshitkin
Copy link

@AlexanderAshitkin AlexanderAshitkin commented Oct 4, 2019

Initial implementation of DefaultGraphBuilder is single threaded and doesn't scale on multi-core servers/workstations.
The proposal is to use fork join pool to build the project graph - as per initial result, graph build time reduced ~2.5 times with -T4 from 14..15 to 5..6 sec

Implementation is rather trivial - current implementation walks projects tree in depth which is naturally fits fork join model - sub-modules are forked and joined to get final result

Risks: mostly mutable objects in domain model and non-functional initial implementation.
Safety could be improved with model rework to immutable model.

Following this checklist to help us incorporate your
contribution quickly and easily:

  • Make sure there is a JIRA issue filed
    for the change (usually before you start working on it). Trivial changes like typos do not
    require a JIRA issue. Your pull request should address just this issue, without
    pulling in other changes.
  • Each commit in the pull request should have a meaningful subject line and body.
  • Format the pull request title like [MNG-XXX] - Fixes bug in ApproximateQuantiles,
    where you replace MNG-XXX with the appropriate JIRA issue. Best practice
    is to use the JIRA issue title in the pull request title and in the first line of the
    commit message.
  • Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
  • Run mvn clean verify to make sure basic checks pass. A more thorough check will
    be performed on your pull request automatically.
  • You have run the Core IT successfully.

If your pull request is about ~20 lines of code you don't need to sign an
Individual Contributor License Agreement if you are unsure
please ask on the developers list.

To make clear that you license your contribution under
the Apache License Version 2.0, January 2004
you have to acknowledge this by using the following check-box.

@eolivelli
Copy link
Contributor

Cool.
Do you have any number to share ?

@AlexanderAshitkin
Copy link
Author

AlexanderAshitkin commented Oct 4, 2019

Hi
so far on my project in conjunction with #288 i achieved speedup from 14..15 seconds to 5..6 seconds .

I also tested apache wicket and results are follwing:
Old -T1
[main] Phase 1: 1406
[main] Phase 2: 6539
[main] Project graph built in: 7958

New -T1
[main] Phase 1: 1413
[main] Phase 2: 2450 (*difference is due to #288)
[main] Project graph built in: 3877

New -T2
[ForkJoinPool-1-worker-1] Phase 1: 845
[ForkJoinPool-1-worker-1] Phase 2: 2443
[main] Project graph built in: 3304

New -T4
[ForkJoinPool-1-worker-1] Phase 1: 955
[ForkJoinPool-1-worker-1] Phase 2: 2642
[main] Project graph built in: 3613

New -T8
[ForkJoinPool-1-worker-1] Phase 1: 1007
[ForkJoinPool-1-worker-1] Phase 2: 2578
[main] Project graph built in: 3608

@filipwiech
Copy link

Hello, any update on this?

@eolivelli
Copy link
Contributor

Sorry.
I forgot about this change.
Your numbers looks promising.
I will take a new look

Copy link
Contributor

@eolivelli eolivelli left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great work.
I left a few comments

We are going to move master to java 8 so we could use lambda but we have to wait for @rfscholte commit

@AlexanderAshitkin
Copy link
Author

rebased on top of current master (3.7.0-SNAPSHOT)

@maximilian-novikov-db
Copy link

any updates please, when it can be merged ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants